21 #define D(x) cout << #x " is " << x << endl
23 const int oo
= INT_MAX
>> 2;
30 for (int i
=1; i
<n
; ++i
){
31 for (int j
=0, x
; j
<i
; ++j
){
34 if (!strcmp(buf
, "x")){
39 g
[i
][j
] = g
[j
][i
] = x
;
44 for (int k
=0; k
<n
; ++k
){
45 for (int i
=0; i
<n
; ++i
){
46 for (int j
=0; j
<n
; ++j
){
47 g
[i
][j
] = min(g
[i
][j
], g
[i
][k
] + g
[k
][j
]);
53 for (int j
=0; j
<n
; ++j
){
54 ans
= max(ans
, g
[0][j
]);